using Unity.Entities;
using UnityEngine;

namespace Kickball.Step2
{
    public struct Player : IComponentData
    {
    }

    public struct Carry : IComponentData, IEnableableComponent
    {
        public Entity Target; //球员携带的球
    }

    public class PlayerAuthoring : MonoBehaviour
    {
        class Baker : Baker<PlayerAuthoring>
        {
            public override void Bake(PlayerAuthoring authoring)
            {
                var entity = GetEntity(TransformUsageFlags.None);
                AddComponent(entity, new Player());

                AddComponent(entity, new Carry());
                SetComponentEnabled<Carry>(entity, false);
            }
        }
    }
}